NodeCountChildren Method

Returns the number of child Nodes for all branch levels (or only those expanded) the specified Node object in the TreeView control.

Syntax

object.NodeCountChildren(Node, VisibleOnly, ForceExpanded)

The NodeCountChildren Method syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
Node Required. A valid Node (MSComctlLib.Node) object. If an empty Node object is passed, then all of the TreeView control's nodes will be tested.
VisibleOnly Optional. A valid Boolean value, as described in settings.
ForceExpanded Optional. A valid Boolean value, as described in settings.

Settings

The settings for VisibleOnly method are:

Setting Description
True Only count child Node objects that are not hidden by a collapsed parent Node object.
False (Default) Count all child Node object regardless of their parent Node object Expand property setting.

The settings for ForceExpanded method are:

Setting Description
True Force the Expand property value = True for all collapsed child Node objects.
False (Default) Do not modify the Expand property value of a child Node object.

Remarks